package com.zyj.pojo;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
@Entity
@Table(name="t_Assetpetition")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Assetpetition {

	private Integer id;
	private String username;
	private String roomname;
	private String memo;
	private Integer quantity;
	private String unit;
	private String fromdepartment;
	private String todepartment;
	private Date petitiondate;
	private Date returndate;
	private Integer keeptime;
	private User user;
	private Asset asset;
	private Room room;
	@Id
	@GeneratedValue(strategy=IDENTITY)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getRoomname() {
		return roomname;
	}
	public void setRoomname(String roomname) {
		this.roomname = roomname;
	}
	public String getMemo() {
		return memo;
	}
	public void setMemo(String memo) {
		this.memo = memo;
	}
	public Integer getQuantity() {
		return quantity;
	}
	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}
	public String getUnit() {
		return unit;
	}
	public void setUnit(String unit) {
		this.unit = unit;
	}
	public String getFromdepartment() {
		return fromdepartment;
	}
	public void setFromdepartment(String fromdepartment) {
		this.fromdepartment = fromdepartment;
	}
	public String getTodepartment() {
		return todepartment;
	}
	public void setTodepartment(String todepartment) {
		this.todepartment = todepartment;
	}
	
	public Date getPetitiondate() {
		return petitiondate;
	}
	public void setPetitiondate(Date petitiondate) {
		this.petitiondate = petitiondate;
	}
	public Date getReturndate() {
		return returndate;
	}
	public void setReturndate(Date returndate) {
		this.returndate = returndate;
	}
	public Integer getKeeptime() {
		return keeptime;
	}
	public void setKeeptime(Integer keeptime) {
		this.keeptime = keeptime;
	}

	@ManyToOne
	@JoinColumn(name="userid")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@ManyToOne
	@JoinColumn(name="assetid")
	public Asset getAsset() {
		return asset;
	}
	public void setAsset(Asset asset) {
		this.asset = asset;
	}
	@ManyToOne
	@JoinColumn(name="roomid")
	public Room getRoom() {
		return room;
	}
	public void setRoom(Room room) {
		this.room = room;
	}
	
	
}
